# from pygame import image,Surface
# from test1 import load_tiles,SIZE,get_tile_rect
# from 假的test2 import fake_create
#
#
# def parse_grid(data):
#     return [list(row) for row in data.strip().split("\n")]
#
#
# def draw_grid(data,tile_img,tiles):
#     xsize=len(data[0])*SIZE
#     ysize=len(data)*SIZE
#     img=Surface((xsize,ysize))
#     for y,row in enumerate(data):
#         for x,char in enumerate(row):
#             rect=get_tile_rect(x,y)#这里参数错误,应该是x,y而不是xsize,ysize
#             img.blit(tile_img,rect,tiles[char])#这里参数顺序错了,要调换rect和tiles[char]的顺序
#     return img
#
#
# if __name__ == '__main__':
#     tile_img,tiles=load_tiles()
#     #这里level的赋值顺序错了,要先create_maze,然后再parse_grid
#     #level=fake_create(6,5)
#     level=create_maze(12,7)
#     level=parse_grid(level)
#     maze=draw_grid(level,tile_img,tiles)
#     image.save(maze,'maze.png')
